package com.shrct.businessprocess.project;

import com.shrct.businessprocess.diagnose.ICanDiagnose;
import com.shrct.businessprocess.diagnose.IDiagnoseAcceptor;
import com.shrct.businessprocess.organization.RCEnterprise;
import com.shrct.businessprocess.product.RCIdentifiablePhysicalProductEntry;
import com.shrct.businessprocess.product.RCProductEntry;
import com.shrct.businessprocess.project.RCCustomerContractMoneyAccept;
import com.shrct.businessprocess.project.RCEarlyBuildInfo;
import com.shrct.businessprocess.project.RCProject;
import com.shrct.businessprocess.project.RCProjectMoney;
import com.shrct.businessprocess.project.RCRealMoney;
import com.shrct.businessprocess.project.impl.RCCustomerContractImpl;
import com.shrct.businessprocess.project.proxy.RCCustomerContractProxy;
import com.shrct.businessprocess.purchase.IHasAcceptedProducts;
import com.shrct.businessprocess.purchase.RCBudgetContract;
import com.shrct.businessprocess.purchase.RCBudgetContractItem;
import com.shrct.businessprocess.purchase.RCHasPurchaseBudget;
import com.shrct.businessprocess.purchase.RCPurchaseIncomeRequest;
import edu.fudan.mylang.pf.EntityImplementation;
import edu.fudan.mylang.pf.IModelObject;
import edu.fudan.mylang.pf.INamedModelObject;
import java.util.Collection;
import java.util.Date;
import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;

@EntityImplementation(implementBy = RCCustomerContractImpl.class)
public interface RCCustomerContract extends IModelObject, INamedModelObject, ICanDiagnose, IHasAcceptedProducts {
  public abstract String getContractId();
  
  public abstract RCCustomerContract setContractId(final String contractId);
  
  public abstract RCEnterprise getCustomer();
  
  public abstract RCCustomerContract setCustomer(final RCEnterprise customer);
  
  public abstract Integer getServiceYears();
  
  public abstract RCCustomerContract setServiceYears(final Integer serviceYears);
  
  public abstract Date getServiceStartDate();
  
  public abstract RCCustomerContract setServiceStartDate(final Date serviceStartDate);
  
  public abstract RCEarlyBuildInfo getEarlyBuildInfo();
  
  public abstract RCCustomerContract setEarlyBuildInfo(final RCEarlyBuildInfo earlyBuildInfo);
  
  public abstract String getComment();
  
  public abstract RCCustomerContract setComment(final String comment);
  
  public abstract Double getServiceAmount();
  
  public abstract RCCustomerContract setServiceAmount(final Double serviceAmount);
  
  public abstract Double getProductAmount();
  
  public abstract Collection<RCCustomerContractMoneyAccept> getMoneyAccepts();
  
  public abstract RCCustomerContractMoneyAccept createAndAddtoMoneyAccepts();
  
  public abstract RCCustomerContractMoneyAccept createAndAddtoMoneyAccepts(final Procedure1<RCCustomerContractMoneyAccept> updater);
  
  public abstract RCCustomerContract removeFromMoneyAccepts(final RCCustomerContractMoneyAccept rCCustomerContractMoneyAccept);
  
  public abstract RCCustomerContract removeAllMoneyAccepts();
  
  public abstract RCProject getProject();
  
  public abstract RCCustomerContract setProject(final RCProject project);
  
  public abstract String getEntityName();
  
  /**
   * 获取合同总金额
   */
  public abstract RCProjectMoney getTotalContractAmount();
  
  /**
   * 获取到款金额
   */
  public abstract RCRealMoney getTotalAcceptedAmount();
  
  public abstract Double getTotalHostAcceptedAmount();
  
  /**
   * 获取开票金额
   */
  public abstract RCProjectMoney getTotalInvoiceAmount();
  
  /**
   * 获取已申请开票金额
   */
  public abstract RCProjectMoney getTotalInvoiceAndUnderInvoiceAmount();
  
  /**
   * 到款未分配至开票的总金额
   */
  public abstract RCRealMoney getTotalWait4AssignmentAmount();
  
  /**
   * 获取该合同总采购清单
   */
  public abstract Collection<RCBudgetContractItem> getAllContractItems();
  
  public abstract Iterable<RCBudgetContract> getAllBudgetContract();
  
  /**
   * 在该客户合同为项目唯一合同的情况下，将预算信息中的销售收入直接分配给该合同
   */
  public abstract void populateToAllBudget();
  
  public abstract Collection<RCPurchaseIncomeRequest> getIncomeRequests();
  
  /**
   * 累计开票销项税
   */
  public abstract Double getIncomeTax();
  
  public abstract Iterable<RCProductEntry> getAllAcceptedProducts();
  
  public abstract Iterable<RCIdentifiablePhysicalProductEntry> getAllTracingProducts();
  
  public abstract Iterable<RCIdentifiablePhysicalProductEntry> getAllTracingProducts(final RCHasPurchaseBudget budget);
  
  public abstract Iterable<RCIdentifiablePhysicalProductEntry> getAllTracingProducts(final RCBudgetContract budgetContract);
  
  public abstract RCCustomerContractMoneyAccept moneyAccepted(final Procedure1<? super RCCustomerContractMoneyAccept> init);
  
  public abstract void diagnose(final IDiagnoseAcceptor acceptor);
  
  public abstract RCCustomerContractProxy toProxy();
}
